#include<stdio.h>
#include<sys/types.h>
#include<sys/stat.h>
#include<fcntl.h>
#include<string.h>
#include<unistd.h>

int main(int argc, char *argv[])
{
    close(1);
    int fd1 = open("log1.txt", O_WRONLY | O_CREAT | O_TRUNC, 0666);
    printf("fd1 : %d\n", fd1);
    fprintf(stdout, "helloworld\n");
    fflush(stdout); 
    close(fd1);
    return 0;
}
